package fr.liglab.adele.icasa.house;

import org.apache.felix.ipojo.annotations.Component;
import org.apache.felix.ipojo.annotations.Invalidate;
import org.apache.felix.ipojo.annotations.Requires;
import org.apache.felix.ipojo.annotations.Validate;

import fr.liglab.adele.icasa.interfaces.IBathroom;
import fr.liglab.adele.icasa.interfaces.IBedroom;
import fr.liglab.adele.icasa.interfaces.IKitchen;
import fr.liglab.adele.icasa.interfaces.ILivingRoom;

@Component
public class House{
	
	@Requires
	ILivingRoom livingroom;
	
	@Requires
	IKitchen kitchen;
	
	@Requires
	IBedroom bedroom;
	
	@Requires
	IBathroom bathroom;
	
	@Validate
	public void starting() {
		System.out.println( " ---------> Intelligent House ACTIVE <--------- " );
		scenario1();
	}
	
	@Invalidate
	public void stopping() {    
		System.out.println( " ---------> Intelligent House INACTIVE <--------- " );
	}
	
	private void scenario1(){
		livingroom.setPresence(0);
		bedroom.setTargetIlluminance(50);
		kitchen.setTargetTemperature(5.0);
		bathroom.setPresence(2);
	}

}
